package com.wang.vagus.exception;

import com.wang.vagus.base.ResultEnum;
import lombok.Data;

@Data
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = -5573491282036316096L;
    private int code;
    private String message;

    public BaseException() {
    }

    public BaseException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BaseException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
        this.message = resultEnum.getMessage();
    }
}
